package com.springboot.java0317springboot.iocdemo;

public class ComputerTest {

    public static void main(String[] args) {
        //硬编码方式创建对象
        Cpu cpu = new AMDCpu();
        Memory memory = new SumsungMemory();
        //设置电脑属性
        Computer computer = new Computer();
        computer.setCpu(cpu);
        computer.setMemory(memory);
        computer.setBrand("华为");
        //开机
        computer.start();
    }
}
